home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / pdox35sc.zip / POPMENU.SC < prev    next >
Text File  |  1991-06-10  |  30KB  |  470 lines

  1. ;****************************************************************************************
  2. ;                      CREATING VERTICAL BOUNCE BAR MENUS
  3.  
  4. ; Copyright 1991   Virginia B. Sauer   All Rights Reserved
  5. ; This program may be copied/modified without charge provided both that this
  6. ; copyright notice is included without change, and that any accompanying
  7. ; documentation includes the notice "Portions of code (c) Copyright 1991,
  8. ; Virginia B. Sauer"
  9. ; ***************************************************************************************
  10.  
  11. ; "Cosmetics" form an integral part of any application.  The user's perception
  12. ; of a system is largely dependent upon its menu system and user interface.
  13.  
  14. ; Generic vertical bounce bar menus can greatly enhance the Paradox interface.
  15. ; Although no more cumbersome than ShowMenu, they can immeasurably help to
  16. ; achieve a professional tone.
  17.  
  18. ; The following procedures (Pop_Main, Pop_Menu, Highlight_Choice, and
  19. ; Key_Pressed) are totally generic - i. e., although they can be modified with
  20. ; respect to colors, et cetera, they will work with any Paradox program.  Write
  21. ; them to a utility library to be available whenever needed.
  22.  
  23. ; These procedures will be called from a menu procedure.  A sample such proc
  24. ; appears at the end of this script.  To invoke the procedure, type Main_Menu()
  25. ; (or whatever name you have selected for the menu in question).
  26.  
  27. ; ╔══════════════════════════════════════════════════════════════════════════════════════╗
  28. ; ║                       PARAMETERS PASSED TO THIS PROCEDURE                            ║
  29. ; ╟───────────────┬────────────────────────┬─────────────────────────────────────────────╢
  30. ; ║   ARGUMENT    │      DESCRIPTION       │                EXAMPLE                      ║
  31. ; ╟───────────────┼────────────────────────┼─────────────────────────────────────────────╢
  32. ; ║               │ Your company's name as │  "T H E    D E V E L O P E R ' S            ║
  33. ; ║               │ it will appear at the  │   T O O L B O X"                            ║
  34. ; ║               │ top of the menu        │                                             ║
  35. ; ║ CompanyHeader │ (e. g., with any       │   (to signify a company named The           ║
  36. ; ║               │ desired spacing)       │   Developer's Toolbox, to appear in upper   ║
  37. ; ║               │                        │   case, with one space between each         ║
  38. ; ║               │ N. B.  This must ap-   │   character, and four spaces between each   ║
  39. ; ║               │        pear in quotes. │   word)                                     ║
  40. ; ╟───────────────┼────────────────────────┼─────────────────────────────────────────────╢
  41. ; ║               │ The name of your       │  "D E M O N S T R A T I O N    O F          ║
  42. ; ║               │ system or application  │   G E N E R I C    U T I L I T I E S"       ║
  43. ; ║               │ as it will appear on   │                                             ║
  44. ; ║               │ your menu (e. g.,      │                                             ║
  45. ; ║ SystemHeader  │ with any desired       │  (to signify a demo application named       ║
  46. ; ║               │ spacing)               │  Demonstration of Generic Utilities, to     ║
  47. ; ║               │                        │  appear in upper case, with one space       ║
  48. ; ║               │ N. B.  This must ap-   │  between each character, and four spaces    ║
  49. ; ║               │        pear in quotes. │  between each word)                         ║
  50. ; ╟───────────────┼────────────────────────┼─────────────────────────────────────────────╢
  51. ; ║               │ The name of the menu   │                                             ║
  52. ; ║               │ (e. g., Report Menu    │            "M A I N    M E N U"             ║
  53. ; ║               │ for a report menu, or  │                                             ║
  54. ; ║   MenuTitle   │ Exit Menu for an exit  │   (to signify the main menu, to appear      ║
  55. ; ║               │ menu)                  │   in upper case, with one space between     ║
  56. ; ║               │                        │   each character, and four spaces between   ║
  57. ; ║               │ N. B.  This must ap-   │   each word)                                ║
  58. ; ║               │        pear in quotes. │                                             ║
  59. ; ╚═══════════════╧════════════════════════╧═════════════════════════════════════════════╝
  60.  
  61. Proc Pop_Main(CompanyHeader,SystemHeader,MenuTitle)
  62.  
  63.    ; -------------- Set colors, variables, and menu choices
  64.    Cursor off
  65.    TextColor     = 32  ; Black on green
  66.    BoxColor      = 13  ; Light magenta on black
  67.    SelectColor   = 90  ; Light green on magenta
  68.    UnselectColor = 10  ; Light green on black
  69.    KeyHelp1      = Format("W74,AC","Press  , Home, End, and/or Space Bar to move highlight, and Enter to")
  70.    KeyHelp2      = Format("W74,AC","select (or, press bold letter of desired option to zoom directly there).")
  71.    MaxLength     = Len(Choicelist[1]) + 2
  72.    BoxColumn     = Round((80-MaxLength)/2,0)
  73.    MenuSize      = ArraySize(ChoiceList)
  74.    TopRow        = Round((25-(MenuSize + 4))/2,0)
  75.    Spacenum      = Round((((Len(Choicelist[1])+2))-(Len(MenuTitle)+22))/4,0)
  76.    MenuTitle     = Spaces(Spacenum) + "   " + Spaces(SpaceNum)
  77.                    + MenuTitle + Spaces(SpaceNum) + "   " + Spaces(Spacenum)
  78.    Pointer       = 1
  79.  
  80.    ; -------------- Initialize Arrays/variables for menu choices / screen coordinates.
  81.    If MenuSize < 10
  82.       Then Numlines = 02
  83.       Else NumLines = 01
  84.            TopRow   = (TopRow + 1)
  85.    Endif
  86.    Array MenuRow[MenuSize]                             ; MenuChoice Rows
  87.    For X From 1 to MenuSize
  88.       MenuRow[X] = (TopRow + NumLines + X)
  89.    EndFor
  90.    BoldColumn   = (BoxColumn + 1)                      ; MenuChoice Bold Letters Columns
  91.    ;--- Uncomment the next line if you are highlighting other than the first letter
  92.    ; XBoldColumn  = (BoxColumn + 2)
  93.    FirstRow     = 01
  94.    LastRow      = 23
  95.    BoxTop       = (MenuRow[1] - 1)
  96.    BoxEnd       = (MenuRow[MenuSize] + 1)
  97.    If MenuSize > 9
  98.       Then FirstRow = (FirstRow - 1)
  99.            LastRow  = (LastRow  + 1)
  100.            BoxTop   = (BoxTop   + 1)
  101.            BoxEnd   = (BoxEnd   - 1)
  102.    Endif
  103.    Pop_Menu()
  104. EndProc
  105.  
  106. ; -------------- Draw outer frame, menu box and static titles.
  107. Proc Pop_Menu()
  108.    Clear Clearall
  109.    Paintcanvas Attribute 00 00, 00, 24, 79 Style attribute 15 ; black
  110.    Draw_Box("Double",05,FirstRow,02,LastRow,77,(FirstRow + 3),(LastRow - 3))
  111.    PaintCanvas Attribute 32 (FirstRow + 1), 03, (FirstRow + 2), 76 Style Attribute TextColor
  112.    @ (FirstRow + 1), Round((80-Len(CompanyHeader))/2,0) ?? CompanyHeader
  113.    @ (FirstRow + 2), Round((80-Len(SystemHeader))/2,0)  ?? SystemHeader
  114.    @ (LastRow  - 2), 03 ?? KeyHelp1
  115.    @ (LastRow  - 1), 03 ?? KeyHelp2
  116.    Style attribute BoxColor
  117.    @  (TopRow - 1), (BoxColumn - 2) ?? "┌", Fill("─",(MaxLength + 2)), "┐"
  118.    @  (Row()  + 1), (BoxColumn - 2) ?? "│", Fill(" ",(MaxLength + 2)), "│"
  119.    @  (Row()  + 1), (BoxColumn - 2) ?? "├", Fill("─",(MaxLength + 2)), "┤"
  120.    For X From BoxTop to BoxEnd
  121.       @ X, (BoxColumn - 2) ?? "│"
  122.       @ X,((BoxColumn - 2) + (MaxLength + 3)) ?? "│"
  123.    EndFor
  124.    @ (Row() + 1), (BoxColumn - 2) ?? "└", Fill("─",(MaxLength + 2)), "┘"
  125.    PaintCanvas Attribute 32 TopRow, (BoxColumn-1), TopRow, ((MaxLength+2)+(BoxColumn-2)) Style Attribute TextColor
  126.    @ (TopRow   ),  Round((80-Len(MenuTitle))/2,0)  ?? MenuTitle
  127.    Style Attribute UnselectColor
  128.       For X From 2 to MenuSize
  129.       @ MenuRow[X], (BoxColumn + 1) ?? ChoiceList[X]
  130.    EndFor
  131.    Style Attribute SelectColor
  132.    @ MenuRow[1], (BoxColumn + 1) ?? ChoiceList[1]
  133.    Key_Pressed()
  134.    Please_Wait("Please wait while information is being extracted.")
  135. EndProc
  136.  
  137. ; ----------- Highlight current option based on last keypress.
  138. Proc Highlight_Choice()
  139.    Style Attribute UnselectColor
  140.    @ MenuRow[OldChoice], (BoxColumn + 1) ?? ChoiceList[OldChoice]
  141.    ;--- Uncomment the following 5 lines if you are highlighting other than the first letter
  142.    ; Style Attribute BoxColor
  143.    ; If OldChoice = MenuSize
  144.    ;    Then @ MenuRow[OldChoice], XBoldColumn ?? Substr(ChoiceList[OldChoice],3,1)
  145.    ;    Else @ MenuRow[OldChoice], BoldColumn  ?? Substr(ChoiceList[OldChoice],2,1)
  146.    ; Endif
  147.    Style Attribute SelectColor
  148.    @ MenuRow[Pointer], (BoxColumn + 1) ?? ChoiceList[Pointer]
  149. EndProc
  150.  
  151. ; ----------- Act upon key pressed by user
  152. Proc Key_Pressed()
  153.    While true
  154.       Style Attribute BoxColor
  155.       ;--- Change this segment for each line highlighting other than first letter
  156.       ;--- e. g., @ MenuRow[MenuSize], XBoldColumn ?? Substr(ChoiceList[MenuSize],2,1)
  157.       For X From 1 to (MenuSize)
  158.          @ MenuRow[X], BoldColumn ?? Substr(ChoiceList[X],1,1)
  159.       EndFor
  160.       OldChoice = Pointer
  161.       Highlight_Choice()
  162.       UserKey = Getchar()
  163.       Switch
  164.          Case Userkey >= 48
  165.           and Userkey <= 122: For X From 1 to MenuSize
  166.                                  If upper(substr(Choicelist[X],1,1)) = upper(chr(Userkey))
  167.                                     Then Pointer = X
  168.                                          Quitloop
  169.                                  Endif
  170.                               EndFor
  171.          ;--- Since many novices do not know how to exit from interactive
  172.          ;    Paradox, the next line traps the Escape key to exit to DOS
  173.          ;    (and/or the user's disk organizer / menu manager).
  174.          ;--- Should you prefer to reassign the Escape key to either invoke
  175.          ;    your own exit routine or to exit to Paradox, change the word
  176.          ;    Exit to Quit on the following line.
  177.          Case UserKey =  27 : Pointer = MenuSize Highlight_Choice() Exit     ; Escape
  178.          Case UserKey =  13 : Quitloop ; [ENTER] so exit Loop/branch to selection
  179.          Case UserKey = -71 : Pointer = 1                     ; [Home]
  180.          Case UserKey = -79 : Pointer = MenuSize              ; [End]
  181.          Case UserKey = -72 : If Pointer <> 1                 ; [Up] - so,
  182.                                  Then Pointer = (Pointer - 1) ; unless first
  183.                                  Else Pointer = MenuSize      ; option,
  184.                               Endif                           ; Move-Highlight()
  185.          Case UserKey = -80 : If Pointer <> MenuSize          ; [Down]
  186.                                  Then Pointer = (Pointer + 1)
  187.                                  Else Pointer = 1
  188.                               Endif
  189.          Case UserKey = 32  : If Pointer <> MenuSize          ; [Spacebar]
  190.                                  Then Pointer = (Pointer + 1)
  191.                                  Else Pointer = 1
  192.                               Endif
  193.       EndSwitch
  194.       If Pointer <> X
  195.          then Highlight_Choice()
  196.               Loop
  197.          else Quitloop
  198.       Endif
  199.    EndWhile
  200. Endproc
  201.  
  202. ; ---------------------------------------------------------------------------------------
  203. ;             SHOW MESSAGE TO PREVENT IMPATIENT USERS FROM WREAKING HAVOC
  204. ;  (A generic procedure utilized by the printer utility, but useful in any application.)
  205. ; ---------------------------------------------------------------------------------------
  206.  
  207. Proc Please_Wait(WaitMssg)                           ; Tell user what is happening
  208.    Cursor Off                                        ; Do not show cursor
  209.    Clear Clearall                                    ; Clear screen and canvas
  210.    PaintCanvas Attribute 00  00, 00, 24, 79          ; Draw black background
  211.    PaintCanvas Attribute 112 10, 07, 14, 75          ; Draw grey shadow
  212.    PaintCanvas Attribute 48  09, 04, 13, 73          ; Draw cyan box
  213.    Style Attribute 176                               ; Draw blinking black characters
  214.    @ 11,05 ??  " \07 \07 \07 "                       ; (Ascii code 7)
  215.    @ 11,66 ??  " \07 \07 \07 "                       ; (Ascii code 7)
  216.    Style Attribute 48                                ; Show black lettering
  217.    @ 11,13 ?? Format("AC,CC,W52",Strval(Waitmssg))   ; Center message (capitalizing
  218. Endproc                                              ; first letter of each word)
  219.  
  220. ; ---------------------------------------------------------------------------------------
  221. ;                         DRAW A COLORED BOX AT GIVEN COORDINATES
  222. ;  (A generic procedure utilized by the printer utility, but useful in any application.)
  223. ; ---------------------------------------------------------------------------------------
  224.  
  225. Proc Draw_Box(LineType,BoxColor,StartRow,StartColumn,Endrow,EndColumn,FirstCross,NextCross)
  226.    Private FillNum,     ; Number of horizontal characters to fill in
  227.            X            ; A counter
  228.    ; --- Determine the number of horizontal characters to fill in between starting and ending
  229.    ;     columns
  230.    Fillnum = (EndColumn - StartColumn -1)
  231.    ; --- Determine appropriate character for each part of the box (e. g., for each type of
  232.    ;     line (single, double, and wide), the upper lefthand corner, upper right hand corner,
  233.    ;     lower left hand corner, lower right hand corner, horizontal, and vertical ... As the
  234.    ;     wide lines distinguish betwen horizontal "top" and "bottom" characters, both
  235.    ;     HorizontalTop and HorizontalBottom are cited.
  236.    Switch
  237.       Case Upper(LineType) = "SINGLE": UpperLeft     = "\218"   UpperRight       = "\191"
  238.                                        LeftCross     = "\195"   RightCross       = "\180"
  239.                                        LowerLeft     = "\192"   LowerRight       = "\217"
  240.                                        HorizontalTop = "\196"   HorizontalBottom = "\196"
  241.                                        Vertical      = "\179"
  242.       Case Upper(LineType) = "DOUBLE": UpperLeft     = "\201"   UpperRight       = "\187"
  243.                                        LeftCross     = "\204"   RightCross       = "\185"
  244.                                        LowerLeft     = "\200"   LowerRight       = "\188"
  245.                                        HorizontalTop = "\205"   HorizontalBottom = "\205"
  246.                                        Vertical      = "\186"
  247.       Case Upper(LineType) = "WIDE":   UpperLeft     = "\219"   UpperRight       = "\219"
  248.                                        LeftCross     = "\219"   RightCross       = "\219"
  249.                                        LowerLeft     = "\219"   LowerRight       = "\219"
  250.                                        HorizontalTop = "\223"   HorizontalBottom = "\220"
  251.                                        Vertical      = "\219"
  252.    EndSwitch
  253.    ; --- Specify the color in which to draw the box
  254.    PaintCanvas Attribute BoxColor StartRow, StartColumn, EndRow, EndColumn  Style Attribute BoxColor
  255.    ; --- At the designated coordinate, draw the top line of the box
  256.    @ StartRow, StartColumn ?? UpperLeft, Fill(HorizontalTop,FillNum), UpperRight
  257.    ; --- Fill in with vertical lines extending from the starting row to the ending row
  258.    For X From (StartRow + 1) to (EndRow - 1)
  259.       @ X,StartColumn ?? Vertical             ; Vertical lines at the "starting" column
  260.       @ X,EndColumn   ?? Vertical             ; Vertical lines at the "ending" column
  261.    EndFor
  262.    ; --- If applicable, add intersecting horizontal "crosslines"
  263.    If not isblank(FirstCross)
  264.       Then @ FirstCross, StartColumn ?? LeftCross, Fill(HorizontalTop,FillNum), RightCross
  265.            If not isblank(NextCross)
  266.               Then @ NextCross,  StartColumn ?? LeftCross, Fill(HorizontalTop,FillNum), RightCross
  267.            Endif
  268.    Endif
  269.    @ EndRow, StartColumn ?? LowerLeft, Fill(HorizontalBottom,FillNum), LowerRight
  270.  
  271. Endproc
  272.  
  273. ; --- If desired, an additional horizontal line may be drawn across the canvas (Since this is
  274. ;     the exception rather than the rule, it is separated from the "main" box-making
  275. ;     procedure to prevent wasting space with seldom- used variables)
  276. Proc Cross_Line(LineType,StartRow,StartColumn,EndColumn)
  277.    Private FillNum,       ; Number of characters to fill in
  278.            X              ; A counter
  279.    ; --- Determine the number of horizontal characters to fill in between starting and ending
  280.    ;     columns
  281.    Fillnum = (EndColumn - StartColumn -1)
  282.    ; --- Determine appropriate "crossline" character for each part of the box (e. g., for
  283.    ;     each type of line (single, double, and wide), the left-hand side character, the
  284.    ;     right-hand side character, and the horizontal character)
  285.    Switch
  286.       Case Upper(LineType) = "SINGLE"       : LeftCross       = "\195"   ; ├
  287.                                               HorizontalCross = "\196"   ; ─
  288.                                               RightCross      = "\180"   ; ┤
  289.       Case Upper(LineType) = "DOUBLE"       : LeftCross       = "\204"   ; ╠
  290.                                               HorizontalCross = "\205"   ; ═
  291.                                               RightCross      = "\185"   ; ╣
  292.       Case Upper(LineType) = "WIDE"         : LeftCross       = "\219"   ; █
  293.                                               HorizontalCross = "\223"   ; ▀
  294.                                               RightCross      = "\219"   ; █
  295.       Case Upper(LineType) = "DOUBLESINGLE" : LeftCross       = "\199"   ; ╟
  296.                                               HorizontalCross = "\196"   ; ─
  297.                                               RightCross      = "\182"   ; ╢
  298.    EndSwitch
  299.    ; --- At the designated coordinate, draw the specified line
  300.    @ StartRow, StartColumn ?? LeftCross, Fill(HorizontalCross,Fillnum), RightCross
  301. Endproc
  302.  
  303. ;*******************************************************************************
  304. ; ***** This is a template, which must be modified for each menu in your application *****
  305.  
  306. ; -- For each menu in your application, give this a suitable name (e. g., Proc
  307. ;    Report_Menu, Proc System_Menu, etc.).
  308.  
  309. ; -- Modify as directed below, depending upon the desired title, options, etc.
  310. ;    (Obviously, you can use as many menus as desired in a given application -
  311. ;    e. g., a Main_Menu, System_Menu, Report_Menu, and Exit_Menu.)
  312. ;*******************************************************************************
  313.  
  314. Proc Main_Menu()
  315.  
  316.    While True
  317.  
  318.       ;-----------------------------------------------------------------------
  319.       ; Modify the options as desired.  (For example, if your menu has only
  320.       ; 5 choices, Array Choicelist[5], and define Choicelist[1] - Choicelist[5].)
  321.       ; Note that each line must begin and end with double quotation marks)
  322.       ;-----------------------------------------------------------------------
  323.  
  324.       Array Choicelist[6]
  325.          Choicelist[1] = "First option     -    e. g., View                         "
  326.          Choicelist[2] = "Second option    -    e. g., Add                          "
  327.          Choicelist[3] = "Third option     -    e. g., Edit                         "
  328.          Choicelist[4] = "Fourth Option    -    e. g., Locate                       "
  329.          Choicelist[5] = "Fifth Option     -    e. g., Change                       "
  330.          Choicelist[6] = "Sixth Option     -    e. g., Quit                         "
  331.  
  332.       ;-----------------------------------------------------------------------
  333.       ; Modify parameters (Company Header, System Header, and Menu Title) as desired
  334.       ; For example, change the company header to the name of your company,
  335.       ; the system header to the name of your application, and the menu title to
  336.       ; the particular menu - R E P O R T   M E N U for a report menu, or whatever.
  337.       ;-----------------------------------------------------------------------
  338.  
  339.       ; Company header, system header, and menu title
  340.       Pop_Main("T H E    D E V E L O P E R ' S    T O O L B O X",
  341.                "D E M O N S T R A T I O N    O F    G E N E R I C   U T I L I T I E S",
  342.                "M A I N    M E N U")
  343.  
  344.          ;-----------------------------------------------------------------------
  345.          ; Branch to subroutine (based on returned value of Pointer).  Insert approporiate
  346.          ; commands (i. e., substituting the names of your own procedures, as in
  347.          ; calling Report_Menu() rather than First_Option(), or whatever.  Delete
  348.          ; unnecessary options - e. g., delete option 6 if your menu offers only 5 options
  349.          ;-----------------------------------------------------------------------
  350.  
  351.          Switch
  352.             Case Pointer =  1 : First_Option()   ; insert appropriate commands here
  353.             Case Pointer =  2 : Second_Option()  ; insert appropriate commands here
  354.             Case Pointer =  3 : Third_Option()   ; insert appropriate commands here
  355.             Case Pointer =  4 : Fourth_Option()  ; insert appropriate commands here
  356.             Case Pointer =  5 : Fifth_Option()   ; insert appropriate commands here
  357.             Case Pointer =  6 : Quit
  358.             Otherwise:          Beep
  359.                                 Loop
  360.          Endswitch
  361.  
  362.    ;-----------------------------------------------------------------------------
  363.    ; Most developers favor "cascading" menu systems, whereby each sub-menu
  364.    ; returns to the preceding or calling menu.  In some instances, you may
  365.    ; prefer to instead return to the main menu, rather than to the menu in
  366.    ; question.  To do so, simply add the word QuitLoop here (on the line
  367.    ; between EndSwitch and EndWhile) to signify that one is not to return to
  368.    ; that particular menu.
  369.    ;-----------------------------------------------------------------------------
  370.  
  371.    Endwhile
  372.  
  373. Endproc
  374.  
  375. ; ╔══════════════════════════════════════════════════════════════════════════════════════╗
  376. ; ║                                   SAMPLE INVOCATION                                  ║
  377. ; ╟──────────────────────────────────────────────────────────────────────────────────────╢
  378. ; ║                                                                                      ║
  379. ; ║  (1)  Procs Pop_Main, Pop_Menu, Highlight_Choice, and Key_Pressed are totally        ║
  380. ; ║       generic ... Just write them to your utility library (or any library of your    ║
  381. ; ║       choice).                                                                       ║
  382. ; ║                                                                                      ║
  383. ; ╟──────────────────────────────────────────────────────────────────────────────────────╢
  384. ; ║                                                                                      ║
  385. ; ║  (2)  Using the Main_Menu procedure as a template, create a separate menu for EACH   ║
  386. ; ║       desired menu, modifying Main_Menu accordingly - e. g., Proc Main_Menu          ║
  387. ; ║       (offering your application's main options), Proc System_Menu (offering its     ║
  388. ; ║       main system options), Proc Report_Menu (offering all report options), and      ║
  389. ; ║       Proc Exit_Menu (offering options to back up data before quitting, and - if     ║
  390. ; ║       not runtime - asking if the user wants to exit to Paradox or DOS).             ║
  391. ; ║                                                                                      ║
  392. ; ║  Proc Exit_Menu()                                                                    ║
  393. ; ║     While true                                                                       ║
  394. ; ║        Array Choicelist [4]                                                          ║
  395. ; ║           Choicelist[1] = "BACK UP    Back up data before quitting               "   ║
  396. ; ║           Choicelist[2] = "PARADOX    Exit to Paradox                            "   ║
  397. ; ║           Choicelist[3] = "DOS        Exit system to DOS                         "   ║
  398. ; ║           Choicelist[4] = "CANCEL     Do not exit; return to program             "   ║
  399. ; ║        Pop_Main("T H E    D E V E L O P E R ' S    T O O L B O X",                   ║
  400. ; ║                 "D E M O    O F    G E N E R I C   U T I L I T I E S",               ║
  401. ; ║                 "E X I T    M E N U")                                                ║
  402. ; ║        Please_Wait("Please wait while information is being extracted.")              ║
  403. ; ║        Switch                                                                        ║
  404. ; ║           Case Pointer = 1 : Backup_Data("Demo","All","C:\\Demo","AT", "A")          ║
  405. ; ║           Case Pointer = 2 : Quit                                                    ║
  406. ; ║           Case Pointer = 3 : Exit                                                    ║
  407. ; ║           Case Pointer = 4 : Quitloop                                                ║
  408. ; ║           Otherwise        : Beep                                                    ║
  409. ; ║                              Loop                                                    ║
  410. ; ║        Endswitch                                                                     ║
  411. ; ║     Endwhile                                                                         ║
  412. ; ║  Endproc                                                                             ║
  413. ; ║                                                                                      ║
  414. ; ╟──────────────────────────────────────────────────────────────────────────────────────╢
  415. ; ║                                                                                      ║
  416. ; ║  (3)  To invoke, "call" this menu just as you would any procedure:  Main_Menu() if   ║
  417. ; ║       it is called Proc Main_Menu, Report_Menu() if it is called Proc Report_Menu,   ║
  418. ; ║       etc.                                                                           ║
  419. ; ║                                                                                      ║
  420. ; ║       For example, Exit_Menu() to invoke the above example                           ║
  421. ; ║                                                                                      ║
  422. ; ╚══════════════════════════════════════════════════════════════════════════════════════╝
  423.  
  424. ; ╔══════════════════════════════════════════════════════════════════════════════════════╗
  425. ; ║                             CONVERTING A SHOWMENU TO A POP_MENU                      ║
  426. ; ╟──────────────────────────────────────────────────────────────────────────────────────╢
  427. ; ║                                                                                      ║
  428. ; ║ Proc Main_Menu()                                                                     ║
  429. ; ║    While true                                                                        ║
  430. ; ║       ShowMenu                                                                       ║
  431. ; ║          "Backup"  : "Back up files"                                                 ║
  432. ; ║          "Printer" : "Set printer defaults"                                          ║
  433. ; ║          "Quit"    : "Quit"                                                          ║
  434. ; ║       To Pointer                                                                     ║
  435. ; ║       Switch                                                                         ║
  436. ; ║          Case Pointer = "Backup" : Backup_Data("Demo","All","C:\\Demo","AT", "A")    ║
  437. ; ║          Case Pointer = "Print"  : Setup_Printer("Portrait","Pica","11",             ║
  438. ; ║                                                  "Printer","Yes")                    ║
  439. ; ║          Case Pointer = "Quit"   : Exit_Menu()                                       ║
  440. ; ║          Otherwise               : Beep                                              ║
  441. ; ║                                    Loop                                              ║
  442. ; ║       EndSwitch                                                                      ║
  443. ; ║    Endwhile                                                                          ║
  444. ; ║ Endproc                                                                              ║
  445. ; ║                                                                                      ║
  446. ; ║                                                                                      ║
  447. ; ║                     THE SAME PROCEDURE AS A POP_MENU:                                ║
  448. ; ║                                                                                      ║
  449. ; ║                                                                                      ║
  450. ; ║ Proc Main_Menu()                                                                     ║
  451. ; ║    While True                                                                        ║
  452. ; ║       Array Choicelist[3]                                                            ║
  453. ; ║          Choicelist[1] = "Backup  -  Back up files                                 " ║
  454. ; ║          Choicelist[2] = "Printer -  Set printer defaults                          " ║
  455. ; ║          Choicelist[3] = "Quit    -  Quit"                                         " ║
  456. ; ║       Pop_Main("T H E    D E V E L O P E R ' S    T O O L B O X",                    ║
  457. ; ║                "D E M O    O F    G E N E R I C   U T I L I T I E S",                ║
  458. ; ║                "M A I N    M E N U")                                                 ║
  459. ; ║       Switch                                                                         ║
  460. ; ║          Case Pointer = 1 : Backup_Data("Demo","All","C:\\Demo","AT", "A")           ║
  461. ; ║          Case Pointer = 2 : Setup_Printer("Portrait","Pica","11",                    ║
  462. ; ║                                           "Printer","Yes")                           ║
  463. ; ║          Case Pointer = 3 : Exit_Menu()                                              ║
  464. ; ║          Otherwise        : Beep                                                     ║
  465. ; ║                             Loop                                                     ║
  466. ; ║       Endswitch                                                                      ║
  467. ; ║    Endwhile                                                                          ║
  468. ; ║ Endproc                                                                              ║
  469. ; ╚══════════════════════════════════════════════════════════════════════════════════════╝
  470.